package com.hm.rabitmq.service;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author shishun.wang
 * @date 2016年12月14日 下午3:12:33
 * @version 1.0
 * @describe
 */
@Component
public class RpcReceiver {

	@RabbitListener(queues = "TEST_SCHEDULE_REMOTE_MQ_TASK")
	@RabbitHandler
	public String processRpc(String hello) {
		try {
			System.out.println("----------------->" + hello);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return hello;
	}

	@RabbitListener(queues = "fanout.B")
	@RabbitHandler
	public void processRpc1(String hello) {
		try {
			System.out.println("---------1-------->>>" + hello);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	@RabbitListener(queues = "fanout.A")
	@RabbitHandler
	public void processRpc2(String hello) {
		try {
			System.out.println("-------2---------->>>" + hello);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
